import { defineStore } from 'pinia'
import api from '@/api/index.js'

export const useMenuStore = defineStore('menu', {
    state: () => ({
        menus: []
    }),
    actions: {
        async fetchMenus(role) {
            const res = await api.getMenu(role)
            console.log(res);

            if (res.status === 200) {
                this.menus = res.data.menuData.menus
            }
        }
    }
}) 